<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Eigen: Tridiagonalization.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
<!--  -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen</a>
   &#160;<span id="projectnumber">3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('Tridiagonalization_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Tridiagonalization.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// This file is part of Eigen, a lightweight C++ template library</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">// for linear algebra.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright (C) 2008 Gael Guennebaud &lt;gael.guennebaud@inria.fr&gt;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// Copyright (C) 2010 Jitse Niesen &lt;jitse@maths.leeds.ac.uk&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// This Source Code Form is subject to the terms of the Mozilla</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">// Public License v. 2.0. If a copy of the MPL was not distributed</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#ifndef EIGEN_TRIDIAGONALIZATION_H</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#define EIGEN_TRIDIAGONALIZATION_H</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;./InternalHeaderCheck.h&quot;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceEigen.html">Eigen</a> {</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">namespace </span>internal {</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType&gt; <span class="keyword">struct </span>TridiagonalizationMatrixTReturnType;</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType&gt;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">struct </span>traits&lt;TridiagonalizationMatrixTReturnType&lt;MatrixType&gt; &gt;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;  : <span class="keyword">public</span> traits&lt;typename MatrixType::PlainObject&gt;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;{</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> MatrixType::PlainObject ReturnType; <span class="comment">// FIXME shall it be a BandMatrix?</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;  <span class="keyword">enum</span> { Flags = 0 };</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;};</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType, <span class="keyword">typename</span> CoeffVectorType&gt;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;EIGEN_DEVICE_FUNC</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="keywordtype">void</span> tridiagonalization_inplace(MatrixType&amp; matA, CoeffVectorType&amp; hCoeffs);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;}</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html">   66</a></span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType_&gt; <span class="keyword">class </span><a class="code" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;{</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160; </div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">   71</a></span>&#160;    <span class="keyword">typedef</span> MatrixType_ <a class="code" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a>;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> MatrixType::Scalar Scalar;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structEigen_1_1NumTraits.html">NumTraits&lt;Scalar&gt;::Real</a> RealScalar;</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#afd806a9be5363077e01028f952c786a8">   75</a></span>&#160;    <span class="keyword">typedef</span> <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Eigen::Index</a> <a class="code" href="classEigen_1_1Tridiagonalization.html#afd806a9be5363077e01028f952c786a8">Index</a>; </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keyword">enum</span> {</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;      Size = MatrixType::RowsAtCompileTime,</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;      SizeMinusOne = Size == <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a> ? <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a> : (Size &gt; 1 ? Size - 1 : 1),</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;      Options = MatrixType::Options,</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;      MaxSize = MatrixType::MaxRowsAtCompileTime,</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;      MaxSizeMinusOne = MaxSize == <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a> ? <a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a> : (MaxSize &gt; 1 ? MaxSize - 1 : 1)</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    };</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="classEigen_1_1Matrix.html">Matrix&lt;Scalar, SizeMinusOne, 1, Options &amp; ~RowMajor, MaxSizeMinusOne, 1&gt;</a> CoeffVectorType;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keyword">typedef</span> <span class="keyword">typename</span> internal::plain_col_type&lt;MatrixType, RealScalar&gt;::type DiagonalType;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="keyword">typedef</span> <a class="code" href="classEigen_1_1Matrix.html">Matrix&lt;RealScalar, SizeMinusOne, 1, Options &amp; ~RowMajor, MaxSizeMinusOne, 1&gt;</a> SubDiagonalType;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keyword">typedef</span> internal::remove_all_t&lt;typename MatrixType::RealReturnType&gt; MatrixTypeRealView;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keyword">typedef</span> internal::TridiagonalizationMatrixTReturnType&lt;MatrixTypeRealView&gt; MatrixTReturnType;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="keyword">typedef</span> std::conditional_t&lt;NumTraits&lt;Scalar&gt;::IsComplex,</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;              internal::add_const_on_value_type_t&lt;typename Diagonal&lt;const MatrixType&gt;::RealReturnType&gt;,</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;              <span class="keyword">const</span> <a class="code" href="classEigen_1_1Diagonal.html">Diagonal&lt;const MatrixType&gt;</a></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;            &gt; DiagonalReturnType;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keyword">typedef</span> std::conditional_t&lt;NumTraits&lt;Scalar&gt;::IsComplex,</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;              internal::add_const_on_value_type_t&lt;<span class="keyword">typename</span> <a class="code" href="classEigen_1_1Diagonal.html">Diagonal</a>&lt;<span class="keyword">const</span> <a class="code" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a>, -1&gt;::RealReturnType&gt;,</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;              <span class="keyword">const</span> <a class="code" href="classEigen_1_1Diagonal.html">Diagonal</a>&lt;<span class="keyword">const</span> <a class="code" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a>, -1&gt;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;            &gt; SubDiagonalReturnType;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#ac8b3065cc11b1c08e74649d4cd53dab0">  102</a></span>&#160;    <span class="keyword">typedef</span> <a class="code" href="classEigen_1_1HouseholderSequence.html">HouseholderSequence&lt;MatrixType,internal::remove_all_t&lt;typename CoeffVectorType::ConjugateReturnType&gt;</a>&gt; <a class="code" href="classEigen_1_1Tridiagonalization.html#ac8b3065cc11b1c08e74649d4cd53dab0">HouseholderSequenceType</a>;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#a009d14f8e6e964f35560b3f339aac87a">  116</a></span>&#160;    <span class="keyword">explicit</span> <a class="code" href="classEigen_1_1Tridiagonalization.html#a009d14f8e6e964f35560b3f339aac87a">Tridiagonalization</a>(<a class="code" href="classEigen_1_1Tridiagonalization.html#afd806a9be5363077e01028f952c786a8">Index</a> size = Size==<a class="code" href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Dynamic</a> ? 2 : Size)</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;      : m_matrix(size,size),</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        m_hCoeffs(size &gt; 1 ? size-1 : 1),</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        m_isInitialized(false)</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    {}</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> InputType&gt;</div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#aef97d3fd6892d66ba94ab83e206c1606">  133</a></span>&#160;    <span class="keyword">explicit</span> <a class="code" href="classEigen_1_1Tridiagonalization.html#aef97d3fd6892d66ba94ab83e206c1606">Tridiagonalization</a>(<span class="keyword">const</span> <a class="code" href="structEigen_1_1EigenBase.html">EigenBase&lt;InputType&gt;</a>&amp; matrix)</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;      : m_matrix(matrix.derived()),</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        m_hCoeffs(matrix.cols() &gt; 1 ? matrix.cols()-1 : 1),</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        m_isInitialized(false)</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    {</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;      internal::tridiagonalization_inplace(m_matrix, m_hCoeffs);</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;      m_isInitialized = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    }</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160; </div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <span class="keyword">template</span>&lt;<span class="keyword">typename</span> InputType&gt;</div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac">  160</a></span>&#160;    <a class="code" href="classEigen_1_1Tridiagonalization.html">Tridiagonalization</a>&amp; <a class="code" href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac">compute</a>(<span class="keyword">const</span> <a class="code" href="structEigen_1_1EigenBase.html">EigenBase&lt;InputType&gt;</a>&amp; matrix)</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    {</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;      m_matrix = matrix.<a class="code" href="structEigen_1_1EigenBase.html#a1fbabe7f12bcbfba3b9a448b1f5e46fa">derived</a>();</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;      m_hCoeffs.<a class="code" href="classEigen_1_1PlainObjectBase.html#a9fd0703bd7bfe89d6dc80e2ce87c312a">resize</a>(matrix.<a class="code" href="structEigen_1_1EigenBase.html#ac22eb0695d00edd7d4a3b2d0a98b81c2">rows</a>()-1, 1);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;      internal::tridiagonalization_inplace(m_matrix, m_hCoeffs);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;      m_isInitialized = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;      <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;    }</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160; </div>
<div class="line"><a name="l00185"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#a682d43187b558a33825bdaa7f2337b32">  185</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="classEigen_1_1Matrix.html">CoeffVectorType</a> <a class="code" href="classEigen_1_1Tridiagonalization.html#a682d43187b558a33825bdaa7f2337b32">householderCoefficients</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="keyword">    </span>{</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;      eigen_assert(m_isInitialized &amp;&amp; <span class="stringliteral">&quot;Tridiagonalization is not initialized.&quot;</span>);</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;      <span class="keywordflow">return</span> m_hCoeffs;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;    }</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160; </div>
<div class="line"><a name="l00222"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#adba57aab0d3876a99092f20b0d0dbc2e">  222</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a>&amp; <a class="code" href="classEigen_1_1Tridiagonalization.html#adba57aab0d3876a99092f20b0d0dbc2e">packedMatrix</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;<span class="keyword">    </span>{</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;      eigen_assert(m_isInitialized &amp;&amp; <span class="stringliteral">&quot;Tridiagonalization is not initialized.&quot;</span>);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;      <span class="keywordflow">return</span> m_matrix;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    }</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160; </div>
<div class="line"><a name="l00243"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#ad5c279c97cee574215ba3f3037e9fbbc">  243</a></span>&#160;    <a class="code" href="classEigen_1_1HouseholderSequence.html">HouseholderSequenceType</a> <a class="code" href="classEigen_1_1Tridiagonalization.html#ad5c279c97cee574215ba3f3037e9fbbc">matrixQ</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;<span class="keyword">    </span>{</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;      eigen_assert(m_isInitialized &amp;&amp; <span class="stringliteral">&quot;Tridiagonalization is not initialized.&quot;</span>);</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="classEigen_1_1Tridiagonalization.html#ac8b3065cc11b1c08e74649d4cd53dab0">HouseholderSequenceType</a>(m_matrix, m_hCoeffs.conjugate())</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;             .setLength(m_matrix.rows() - 1)</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;             .setShift(1);</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    }</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160; </div>
<div class="line"><a name="l00268"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345">  268</a></span>&#160;    MatrixTReturnType <a class="code" href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345">matrixT</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;<span class="keyword">    </span>{</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;      eigen_assert(m_isInitialized &amp;&amp; <span class="stringliteral">&quot;Tridiagonalization is not initialized.&quot;</span>);</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;      <span class="keywordflow">return</span> MatrixTReturnType(m_matrix.real());</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    }</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160; </div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    DiagonalReturnType <a class="code" href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e">diagonal</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160; </div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    SubDiagonalReturnType <a class="code" href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e">subDiagonal</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160; </div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160; </div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    <a class="code" href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">MatrixType</a> m_matrix;</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    CoeffVectorType m_hCoeffs;</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    <span class="keywordtype">bool</span> m_isInitialized;</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;};</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160; </div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType&gt;</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;<span class="keyword">typename</span> Tridiagonalization&lt;MatrixType&gt;::DiagonalReturnType</div>
<div class="line"><a name="l00310"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e">  310</a></span>&#160;<a class="code" href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e">Tridiagonalization&lt;MatrixType&gt;::diagonal</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;  eigen_assert(m_isInitialized &amp;&amp; <span class="stringliteral">&quot;Tridiagonalization is not initialized.&quot;</span>);</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;  <span class="keywordflow">return</span> m_matrix.diagonal().real();</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;}</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160; </div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType&gt;</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;<span class="keyword">typename</span> Tridiagonalization&lt;MatrixType&gt;::SubDiagonalReturnType</div>
<div class="line"><a name="l00318"></a><span class="lineno"><a class="line" href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e">  318</a></span>&#160;<a class="code" href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e">Tridiagonalization&lt;MatrixType&gt;::subDiagonal</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;  eigen_assert(m_isInitialized &amp;&amp; <span class="stringliteral">&quot;Tridiagonalization is not initialized.&quot;</span>);</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;  <span class="keywordflow">return</span> m_matrix.template diagonal&lt;-1&gt;().<a class="code" href="namespaceEigen.html#ac74dc920119b1eba45e9218d9f402afc">real</a>();</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;}</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160; </div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;<span class="keyword">namespace </span>internal {</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160; </div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType, <span class="keyword">typename</span> CoeffVectorType&gt;</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;EIGEN_DEVICE_FUNC</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;<span class="keywordtype">void</span> tridiagonalization_inplace(MatrixType&amp; matA, CoeffVectorType&amp; hCoeffs)</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;{</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  <span class="keyword">using</span> numext::conj;</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> MatrixType::Scalar Scalar;</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> MatrixType::RealScalar RealScalar;</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;  <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> n = matA.rows();</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;  eigen_assert(n==matA.cols());</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;  eigen_assert(n==hCoeffs.size()+1 || n==1);</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160; </div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;  <span class="keywordflow">for</span> (<a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> i = 0; i&lt;n-1; ++i)</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;  {</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> remainingSize = n-i-1;</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;    RealScalar beta;</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    Scalar h;</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;    matA.col(i).tail(remainingSize).makeHouseholderInPlace(h, beta);</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160; </div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    <span class="comment">// Apply similarity transformation to remaining columns,</span></div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;    <span class="comment">// i.e., A = H A H&#39; where H = I - h v v&#39; and v = matA.col(i).tail(n-i-1)</span></div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    matA.col(i).coeffRef(i+1) = 1;</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160; </div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    hCoeffs.tail(n-i-1).noalias() = (matA.bottomRightCorner(remainingSize,remainingSize).template selfadjointView&lt;Lower&gt;()</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;                                  * (<a class="code" href="namespaceEigen.html#ab84f39a06a18e1ebb23f8be80345b79d">conj</a>(h) * matA.col(i).tail(remainingSize)));</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160; </div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;    hCoeffs.tail(n-i-1) += (<a class="code" href="namespaceEigen.html#ab84f39a06a18e1ebb23f8be80345b79d">conj</a>(h)*RealScalar(-0.5)*(hCoeffs.tail(remainingSize).dot(matA.col(i).tail(remainingSize)))) * matA.col(i).tail(n-i-1);</div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160; </div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;    matA.bottomRightCorner(remainingSize, remainingSize).template selfadjointView&lt;Lower&gt;()</div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;      .rankUpdate(matA.col(i).tail(remainingSize), hCoeffs.tail(remainingSize), Scalar(-1));</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160; </div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;    matA.col(i).coeffRef(i+1) = beta;</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;    hCoeffs.coeffRef(i) = h;</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;  }</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;}</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160; </div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;<span class="comment">// forward declaration, implementation at the end of this file</span></div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType,</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;         <span class="keywordtype">int</span> Size=MatrixType::ColsAtCompileTime,</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;         <span class="keywordtype">bool</span> IsComplex=NumTraits&lt;typename MatrixType::Scalar&gt;::IsComplex&gt;</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;<span class="keyword">struct </span>tridiagonalization_inplace_selector;</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160; </div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType, <span class="keyword">typename</span> DiagonalType, <span class="keyword">typename</span> SubDiagonalType, <span class="keyword">typename</span> CoeffVectorType&gt;</div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;EIGEN_DEVICE_FUNC</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;<span class="keywordtype">void</span> tridiagonalization_inplace(MatrixType&amp; mat, DiagonalType&amp; diag, SubDiagonalType&amp; subdiag,</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;                                CoeffVectorType&amp; hcoeffs, <span class="keywordtype">bool</span> extractQ)</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;{</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;  eigen_assert(mat.cols()==mat.rows() &amp;&amp; diag.size()==mat.rows() &amp;&amp; subdiag.size()==mat.rows()-1);</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;  tridiagonalization_inplace_selector&lt;MatrixType&gt;::run(mat, diag, subdiag, hcoeffs, extractQ);</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;}</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160; </div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType, <span class="keywordtype">int</span> Size, <span class="keywordtype">bool</span> IsComplex&gt;</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;<span class="keyword">struct </span>tridiagonalization_inplace_selector</div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;{</div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classEigen_1_1Tridiagonalization.html#ac8b3065cc11b1c08e74649d4cd53dab0">Tridiagonalization&lt;MatrixType&gt;::HouseholderSequenceType</a> HouseholderSequenceType;</div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DiagonalType, <span class="keyword">typename</span> SubDiagonalType, <span class="keyword">typename</span> CoeffVectorType&gt;</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;  <span class="keyword">static</span> EIGEN_DEVICE_FUNC</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;      <span class="keywordtype">void</span> run(MatrixType&amp; mat, DiagonalType&amp; diag, SubDiagonalType&amp; subdiag, CoeffVectorType&amp; hCoeffs, <span class="keywordtype">bool</span> extractQ)</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;  {</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;    tridiagonalization_inplace(mat, hCoeffs);</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    diag = mat.diagonal().real();</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;    subdiag = mat.template diagonal&lt;-1&gt;().<a class="code" href="namespaceEigen.html#ac74dc920119b1eba45e9218d9f402afc">real</a>();</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;    <span class="keywordflow">if</span>(extractQ)</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;      mat = HouseholderSequenceType(mat, hCoeffs.conjugate())</div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;            .setLength(mat.rows() - 1)</div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;            .setShift(1);</div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;  }</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;};</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160; </div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType&gt;</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;<span class="keyword">struct </span>tridiagonalization_inplace_selector&lt;MatrixType,3,false&gt;</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;{</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> MatrixType::Scalar Scalar;</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> MatrixType::RealScalar RealScalar;</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160; </div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DiagonalType, <span class="keyword">typename</span> SubDiagonalType, <span class="keyword">typename</span> CoeffVectorType&gt;</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">void</span> run(MatrixType&amp; mat, DiagonalType&amp; diag, SubDiagonalType&amp; subdiag, CoeffVectorType&amp;, <span class="keywordtype">bool</span> extractQ)</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;  {</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;    <span class="keyword">using</span> std::sqrt;</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;    <span class="keyword">const</span> RealScalar tol = (std::numeric_limits&lt;RealScalar&gt;::min)();</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;    diag[0] = mat(0,0);</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;    RealScalar v1norm2 = numext::abs2(mat(2,0));</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;    <span class="keywordflow">if</span>(v1norm2 &lt;= tol)</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;    {</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;      diag[1] = mat(1,1);</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;      diag[2] = mat(2,2);</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;      subdiag[0] = mat(1,0);</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;      subdiag[1] = mat(2,1);</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;      <span class="keywordflow">if</span> (extractQ)</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;        mat.setIdentity();</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;    }</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;    {</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;      RealScalar beta = <a class="code" href="namespaceEigen.html#af4f536e8ea56702e63088efb3706d1f0">sqrt</a>(numext::abs2(mat(1,0)) + v1norm2);</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;      RealScalar invBeta = RealScalar(1)/beta;</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;      Scalar m01 = mat(1,0) * invBeta;</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;      Scalar m02 = mat(2,0) * invBeta;</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;      Scalar q = RealScalar(2)*m01*mat(2,1) + m02*(mat(2,2) - mat(1,1));</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;      diag[1] = mat(1,1) + m02*q;</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;      diag[2] = mat(2,2) - m02*q;</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;      subdiag[0] = beta;</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;      subdiag[1] = mat(2,1) - m01 * q;</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;      <span class="keywordflow">if</span> (extractQ)</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;      {</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;        mat &lt;&lt; 1,   0,    0,</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;               0, m01,  m02,</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;               0, m02, -m01;</div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;      }</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;    }</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;  }</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;};</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160; </div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType, <span class="keywordtype">bool</span> IsComplex&gt;</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;<span class="keyword">struct </span>tridiagonalization_inplace_selector&lt;MatrixType,1,IsComplex&gt;</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;{</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;  <span class="keyword">typedef</span> <span class="keyword">typename</span> MatrixType::Scalar Scalar;</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160; </div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;  <span class="keyword">template</span>&lt;<span class="keyword">typename</span> DiagonalType, <span class="keyword">typename</span> SubDiagonalType, <span class="keyword">typename</span> CoeffVectorType&gt;</div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;  <span class="keyword">static</span> EIGEN_DEVICE_FUNC</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;  <span class="keywordtype">void</span> run(MatrixType&amp; mat, DiagonalType&amp; diag, SubDiagonalType&amp;, CoeffVectorType&amp;, <span class="keywordtype">bool</span> extractQ)</div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;  {</div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;    diag(0,0) = numext::real(mat(0,0));</div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;    <span class="keywordflow">if</span>(extractQ)</div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;      mat(0,0) = Scalar(1);</div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;  }</div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;};</div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160; </div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType&gt; <span class="keyword">struct </span>TridiagonalizationMatrixTReturnType</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;: <span class="keyword">public</span> ReturnByValue&lt;TridiagonalizationMatrixTReturnType&lt;MatrixType&gt; &gt;</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;{</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;    TridiagonalizationMatrixTReturnType(<span class="keyword">const</span> MatrixType&amp; mat) : m_matrix(mat) { }</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160; </div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ResultType&gt;</div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> evalTo(ResultType&amp; result)<span class="keyword"> const</span></div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;<span class="keyword">    </span>{</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;      result.setZero();</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;      result.template diagonal&lt;1&gt;() = m_matrix.template diagonal&lt;-1&gt;().conjugate();</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;      result.diagonal() = m_matrix.diagonal();</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;      result.template diagonal&lt;-1&gt;() = m_matrix.template diagonal&lt;-1&gt;();</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;    }</div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160; </div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;    EIGEN_CONSTEXPR <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> rows() const EIGEN_NOEXCEPT { <span class="keywordflow">return</span> m_matrix.rows(); }</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;    EIGEN_CONSTEXPR <a class="code" href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Index</a> cols() const EIGEN_NOEXCEPT { <span class="keywordflow">return</span> m_matrix.cols(); }</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160; </div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;  <span class="keyword">protected</span>:</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;    <span class="keyword">typename</span> MatrixType::Nested m_matrix;</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;};</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160; </div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;} <span class="comment">// end namespace internal</span></div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160; </div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;} <span class="comment">// end namespace Eigen</span></div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160; </div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// EIGEN_TRIDIAGONALIZATION_H</span></div>
<div class="ttc" id="aclassEigen_1_1Diagonal_html"><div class="ttname"><a href="classEigen_1_1Diagonal.html">Eigen::Diagonal</a></div><div class="ttdoc">Expression of a diagonal/subdiagonal/superdiagonal in a matrix.</div><div class="ttdef"><b>Definition:</b> Diagonal.h:67</div></div>
<div class="ttc" id="aclassEigen_1_1HouseholderSequence_html"><div class="ttname"><a href="classEigen_1_1HouseholderSequence.html">Eigen::HouseholderSequence</a></div><div class="ttdoc">Sequence of Householder reflections acting on subspaces with decreasing size.</div><div class="ttdef"><b>Definition:</b> HouseholderSequence.h:123</div></div>
<div class="ttc" id="aclassEigen_1_1Matrix_html"><div class="ttname"><a href="classEigen_1_1Matrix.html">Eigen::Matrix&lt; Scalar, SizeMinusOne, 1, Options &amp;~RowMajor, MaxSizeMinusOne, 1 &gt;</a></div></div>
<div class="ttc" id="aclassEigen_1_1PlainObjectBase_html_a9fd0703bd7bfe89d6dc80e2ce87c312a"><div class="ttname"><a href="classEigen_1_1PlainObjectBase.html#a9fd0703bd7bfe89d6dc80e2ce87c312a">Eigen::PlainObjectBase::resize</a></div><div class="ttdeci">void resize(Index rows, Index cols)</div><div class="ttdef"><b>Definition:</b> PlainObjectBase.h:283</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html">Eigen::Tridiagonalization</a></div><div class="ttdoc">Tridiagonal decomposition of a selfadjoint matrix.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:67</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_a009d14f8e6e964f35560b3f339aac87a"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#a009d14f8e6e964f35560b3f339aac87a">Eigen::Tridiagonalization::Tridiagonalization</a></div><div class="ttdeci">Tridiagonalization(Index size=Size==Dynamic ? 2 :Size)</div><div class="ttdoc">Default constructor.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:116</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_a0b7ff4860aa6f7c0761b1059c012fd8e"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#a0b7ff4860aa6f7c0761b1059c012fd8e">Eigen::Tridiagonalization::diagonal</a></div><div class="ttdeci">DiagonalReturnType diagonal() const</div><div class="ttdoc">Returns the diagonal of the tridiagonal matrix T in the decomposition.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:310</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_a3ee270966d18659018688662253dca23"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#a3ee270966d18659018688662253dca23">Eigen::Tridiagonalization::MatrixType</a></div><div class="ttdeci">MatrixType_ MatrixType</div><div class="ttdoc">Synonym for the template parameter MatrixType_.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:71</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_a54ada2bbc4b27c64c0264b72e8caaaac"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#a54ada2bbc4b27c64c0264b72e8caaaac">Eigen::Tridiagonalization::compute</a></div><div class="ttdeci">Tridiagonalization &amp; compute(const EigenBase&lt; InputType &gt; &amp;matrix)</div><div class="ttdoc">Computes tridiagonal decomposition of given matrix.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:160</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_a682d43187b558a33825bdaa7f2337b32"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#a682d43187b558a33825bdaa7f2337b32">Eigen::Tridiagonalization::householderCoefficients</a></div><div class="ttdeci">CoeffVectorType householderCoefficients() const</div><div class="ttdoc">Returns the Householder coefficients.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:185</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_ac423dbb91157c159bdcb4b5a8371232e"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#ac423dbb91157c159bdcb4b5a8371232e">Eigen::Tridiagonalization::subDiagonal</a></div><div class="ttdeci">SubDiagonalReturnType subDiagonal() const</div><div class="ttdoc">Returns the subdiagonal of the tridiagonal matrix T in the decomposition.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:318</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_ac8b3065cc11b1c08e74649d4cd53dab0"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#ac8b3065cc11b1c08e74649d4cd53dab0">Eigen::Tridiagonalization::HouseholderSequenceType</a></div><div class="ttdeci">HouseholderSequence&lt; MatrixType, internal::remove_all_t&lt; typename CoeffVectorType::ConjugateReturnType &gt; &gt; HouseholderSequenceType</div><div class="ttdoc">Return type of matrixQ()</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:102</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_ad5c279c97cee574215ba3f3037e9fbbc"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#ad5c279c97cee574215ba3f3037e9fbbc">Eigen::Tridiagonalization::matrixQ</a></div><div class="ttdeci">HouseholderSequenceType matrixQ() const</div><div class="ttdoc">Returns the unitary matrix Q in the decomposition.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:243</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_adba57aab0d3876a99092f20b0d0dbc2e"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#adba57aab0d3876a99092f20b0d0dbc2e">Eigen::Tridiagonalization::packedMatrix</a></div><div class="ttdeci">const MatrixType &amp; packedMatrix() const</div><div class="ttdoc">Returns the internal representation of the decomposition.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:222</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_aef08c38d78a60c3e8277081761a52345"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#aef08c38d78a60c3e8277081761a52345">Eigen::Tridiagonalization::matrixT</a></div><div class="ttdeci">MatrixTReturnType matrixT() const</div><div class="ttdoc">Returns an expression of the tridiagonal matrix T in the decomposition.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:268</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_aef97d3fd6892d66ba94ab83e206c1606"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#aef97d3fd6892d66ba94ab83e206c1606">Eigen::Tridiagonalization::Tridiagonalization</a></div><div class="ttdeci">Tridiagonalization(const EigenBase&lt; InputType &gt; &amp;matrix)</div><div class="ttdoc">Constructor; computes tridiagonal decomposition of given matrix.</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:133</div></div>
<div class="ttc" id="aclassEigen_1_1Tridiagonalization_html_afd806a9be5363077e01028f952c786a8"><div class="ttname"><a href="classEigen_1_1Tridiagonalization.html#afd806a9be5363077e01028f952c786a8">Eigen::Tridiagonalization::Index</a></div><div class="ttdeci">Eigen::Index Index</div><div class="ttdef"><b>Definition:</b> Tridiagonalization.h:75</div></div>
<div class="ttc" id="anamespaceEigen_html"><div class="ttname"><a href="namespaceEigen.html">Eigen</a></div><div class="ttdoc">Namespace containing all symbols from the Eigen library.</div><div class="ttdef"><b>Definition:</b> Core:139</div></div>
<div class="ttc" id="anamespaceEigen_html_a62e77e0933482dafde8fe197d9a2cfde"><div class="ttname"><a href="namespaceEigen.html#a62e77e0933482dafde8fe197d9a2cfde">Eigen::Index</a></div><div class="ttdeci">EIGEN_DEFAULT_DENSE_INDEX_TYPE Index</div><div class="ttdoc">The Index type as used for the API.</div><div class="ttdef"><b>Definition:</b> Meta.h:59</div></div>
<div class="ttc" id="anamespaceEigen_html_ab84f39a06a18e1ebb23f8be80345b79d"><div class="ttname"><a href="namespaceEigen.html#ab84f39a06a18e1ebb23f8be80345b79d">Eigen::conj</a></div><div class="ttdeci">const Eigen::CwiseUnaryOp&lt; Eigen::internal::scalar_conjugate_op&lt; typename Derived::Scalar &gt;, const Derived &gt; conj(const Eigen::ArrayBase&lt; Derived &gt; &amp;x)</div></div>
<div class="ttc" id="anamespaceEigen_html_ac74dc920119b1eba45e9218d9f402afc"><div class="ttname"><a href="namespaceEigen.html#ac74dc920119b1eba45e9218d9f402afc">Eigen::real</a></div><div class="ttdeci">const Eigen::CwiseUnaryOp&lt; Eigen::internal::scalar_real_op&lt; typename Derived::Scalar &gt;, const Derived &gt; real(const Eigen::ArrayBase&lt; Derived &gt; &amp;x)</div></div>
<div class="ttc" id="anamespaceEigen_html_ad81fa7195215a0ce30017dfac309f0b2"><div class="ttname"><a href="namespaceEigen.html#ad81fa7195215a0ce30017dfac309f0b2">Eigen::Dynamic</a></div><div class="ttdeci">const int Dynamic</div><div class="ttdef"><b>Definition:</b> Constants.h:24</div></div>
<div class="ttc" id="anamespaceEigen_html_af4f536e8ea56702e63088efb3706d1f0"><div class="ttname"><a href="namespaceEigen.html#af4f536e8ea56702e63088efb3706d1f0">Eigen::sqrt</a></div><div class="ttdeci">const Eigen::CwiseUnaryOp&lt; Eigen::internal::scalar_sqrt_op&lt; typename Derived::Scalar &gt;, const Derived &gt; sqrt(const Eigen::ArrayBase&lt; Derived &gt; &amp;x)</div></div>
<div class="ttc" id="astructEigen_1_1EigenBase_html"><div class="ttname"><a href="structEigen_1_1EigenBase.html">Eigen::EigenBase</a></div><div class="ttdef"><b>Definition:</b> EigenBase.h:32</div></div>
<div class="ttc" id="astructEigen_1_1EigenBase_html_a1fbabe7f12bcbfba3b9a448b1f5e46fa"><div class="ttname"><a href="structEigen_1_1EigenBase.html#a1fbabe7f12bcbfba3b9a448b1f5e46fa">Eigen::EigenBase::derived</a></div><div class="ttdeci">Derived &amp; derived()</div><div class="ttdef"><b>Definition:</b> EigenBase.h:48</div></div>
<div class="ttc" id="astructEigen_1_1EigenBase_html_ac22eb0695d00edd7d4a3b2d0a98b81c2"><div class="ttname"><a href="structEigen_1_1EigenBase.html#ac22eb0695d00edd7d4a3b2d0a98b81c2">Eigen::EigenBase::rows</a></div><div class="ttdeci">EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT</div><div class="ttdef"><b>Definition:</b> EigenBase.h:62</div></div>
<div class="ttc" id="astructEigen_1_1NumTraits_html"><div class="ttname"><a href="structEigen_1_1NumTraits.html">Eigen::NumTraits</a></div><div class="ttdoc">Holds information about the various numeric (i.e. scalar) types allowed by Eigen.</div><div class="ttdef"><b>Definition:</b> NumTraits.h:231</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_a62d91f57b5fefafb116d3f5c1ce792a.html">Eigen</a></li><li class="navelem"><a class="el" href="dir_f84311377820247c2dbcf5d6a63ab308.html">src</a></li><li class="navelem"><a class="el" href="dir_2acdd4a7111883be1340ec0999e47118.html">Eigenvalues</a></li><li class="navelem"><b>Tridiagonalization.h</b></li>
    <li class="footer">Generated on Thu Apr 21 2022 13:07:54 for Eigen by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
